﻿/*
 * kalman.h
 *
 * Created: 2013-08-22 오전 8:25:48
 *  Author: akkdong
 */ 


#ifndef KALMAN_H_
#define KALMAN_H_


///////////////////////////////////////////////////////////////////////////////////////
//

typedef struct tag_KalmanFilter
{
	double x_abs;
	double x_vel;
	
	double p_abs_abs;
	double p_abs_vel;
	double p_vel_vel;
	
	double var_accel;
	
	double y;
	double s_inv;
	double k_abs;
	double k_vel;
	
} KalmanFilter;



///////////////////////////////////////////////////////////////////////////////////////
//

void		kalman_init(KalmanFilter * handle, double var_accel);	// default var_accel = 1.0
void		kalman_reset(KalmanFilter * handle, double abs_value, double vel_value);
void		kalman_setAccelerationVariance(KalmanFilter * handle, double var_accel);
void		kalman_update(KalmanFilter * handle, double z_abs, double var_z_abs, double dt);
double		kalman_getXAbs(KalmanFilter * handle);
double		kalman_getXVel(KalmanFilter * handle);
double		kalman_getCovAbsAbs(KalmanFilter * handle);
double		kalman_getCovAbsVel(KalmanFilter * handle);
double		kalman_getCovVelVel(KalmanFilter * handle);



#endif /* KALMAN_H_ */